package puzzle.projecteuler.p300;

import java.util.ArrayList;
import java.util.List;

import astudy.util.AdvMath;


public class Problem216B {
	

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		
		int m = 10000;
	
		long s = System.currentTimeMillis();
		Integer[] tmp = AdvMath.primes(m);
		List<Integer> ps = new ArrayList<Integer>();
		List<Integer> cs = new ArrayList<Integer>();
		for (Integer t: tmp) {
			if (t%8 == 1 || t%8 == 7) {
				ps.add(t);
				for (int c = 0; c < t; c ++) {
					if ((2*c*c)%t == 1) {
						cs.add(c);
						break;
					}
				}
			}
		}
		System.out.println("sum = " + tmp.length);
		tmp = null;
		System.out.println("sum = " + ps.size());
		System.out.println((System.currentTimeMillis()-s) + " ms");
	}
}
